﻿<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="clr-namespace:ESRI.ArcGIS.Client.Toolkit">
    <Style TargetType="local:FeatureDataForm">
        <Setter Property="Background">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FFF3F7FA" Offset="0"/>
                    <GradientStop Color="#FFFFFFFF" Offset="0.1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderBrush">
            <Setter.Value>
                <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                    <GradientStop Color="#FFA3AEB9" Offset="0"/>
                    <GradientStop Color="#FF8399A9" Offset="0.375"/>
                    <GradientStop Color="#FF718597" Offset="0.375"/>
                    <GradientStop Color="#FF617584" Offset="1"/>
                </LinearGradientBrush>
            </Setter.Value>
        </Setter>
        <Setter Property="BorderThickness" Value="1"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:FeatureDataForm">
                    <Border x:Name="DataFormBorder" Background="{TemplateBinding Background}" 
                            BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="2" 
                            BorderThickness="{TemplateBinding BorderThickness}">
                        <Border.Resources>
                            <Style x:Key="CustomScrollViewerStyle" TargetType="ScrollViewer">
                                <Setter Property="BorderThickness" Value="0,1"/>
                                <Setter Property="Template">
                                    <Setter.Value>
                                        <ControlTemplate TargetType="ScrollViewer">
                                            <Grid>
                                                <Border Margin="0,-1" Opacity="0.2" BorderBrush="{TemplateBinding BorderBrush}" 
                                                        BorderThickness="{TemplateBinding BorderThickness}" 
                                                        Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}">
                                                    <Border.OpacityMask>
                                                        <LinearGradientBrush EndPoint="1.07,0.5" StartPoint="-0.07,0.5">
                                                            <GradientStop Color="#FF000000"/>
                                                            <GradientStop Color="#7FFFFFFF" Offset="0.5"/>
                                                            <GradientStop Color="#FF000000" Offset="1"/>
                                                        </LinearGradientBrush>
                                                    </Border.OpacityMask>
                                                </Border>
                                                <Grid Background="{TemplateBinding Background}">
                                                    <Grid.RowDefinitions>
                                                        <RowDefinition Height="*"/>
                                                        <RowDefinition Height="Auto"/>
                                                    </Grid.RowDefinitions>
                                                    <Grid.ColumnDefinitions>
                                                        <ColumnDefinition Width="*"/>
                                                        <ColumnDefinition Width="Auto"/>
                                                    </Grid.ColumnDefinitions>
                                                    <ScrollContentPresenter x:Name="ScrollContentPresenter" 
                                                                            Cursor="{TemplateBinding Cursor}" 
                                                                            Margin="{TemplateBinding Padding}" 
                                                                            ContentTemplate="{TemplateBinding ContentTemplate}"/>
                                                    <Rectangle Fill="#FFE9EEF4" Grid.Column="1" Grid.Row="1"/>
                                                    <ScrollBar x:Name="VerticalScrollBar" Margin="0,-1" Width="18" 
                                                               Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" 
                                                               IsTabStop="False" Grid.Column="1" Grid.Row="0" 
                                                               Maximum="{TemplateBinding ScrollableHeight}" Minimum="0" 
                                                               Value="{TemplateBinding VerticalOffset}" Orientation="Vertical" 
                                                               ViewportSize="{TemplateBinding ViewportHeight}"/>
                                                    <ScrollBar x:Name="HorizontalScrollBar" Height="18" Margin="-1,0,-1,-1" 
                                                               Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" 
                                                               IsTabStop="False" Grid.Column="0" Grid.Row="1" 
                                                               Maximum="{TemplateBinding ScrollableWidth}" Minimum="0" 
                                                               Value="{TemplateBinding HorizontalOffset}" Orientation="Horizontal" 
                                                               ViewportSize="{TemplateBinding ViewportWidth}"/>
                                                </Grid>
                                            </Grid>
                                        </ControlTemplate>
                                    </Setter.Value>
                                </Setter>
                            </Style>
                        </Border.Resources>
                        <Grid>
                            <Grid.RowDefinitions>
                                <RowDefinition Height="*" />
                                <RowDefinition Height="Auto" />
                            </Grid.RowDefinitions>
                            <ScrollViewer Style="{StaticResource CustomScrollViewerStyle}" IsTabStop="False" 
                                          Background="{x:Null}" Padding="{TemplateBinding Padding}" 
                                          VerticalScrollBarVisibility="Auto">
                                <ContentPresenter x:Name="ContentPresenter" Margin="12,12,6,12"/>
                            </ScrollViewer>
                            <Grid Grid.Row="1" Margin="0,8,0,8">
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="*" />
                                    <ColumnDefinition Width="Auto" />
                                    <ColumnDefinition Width="Auto" />
                                </Grid.ColumnDefinitions>
                                <Button x:Name="CommitButton" Content="{TemplateBinding CommitButtonContent}" Margin="0,0,12,0" 
                                        Style="{TemplateBinding CommitButtonStyle}" 
                                        MinWidth="75" MinHeight="22" Visibility="Collapsed" Grid.Column="1"
                                        HorizontalAlignment="Right" VerticalAlignment="Center" 
                                        HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                                <Button x:Name="DeleteButton" Content="{TemplateBinding DeleteButtonContent}" Margin="0,0,12,0" 
                                        Style="{TemplateBinding DeleteButtonStyle}" 
                                        MinWidth="75" MinHeight="22" Visibility="Collapsed" Grid.Column="2"
                                        HorizontalAlignment="Right" VerticalAlignment="Center" IsEnabled="False"
                                        HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
                            </Grid>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>